package ru.isa.dcs.iarnet.util;

import java.util.*;
import Ice.Util.*;
import java.io.*;
import java.net.URL;

public class PropertyReader {

	public static void main(String[] args)	throws IOException {
		Ice.InitializationData inDat = new Ice.InitializationData();
		Ice.Properties iceProps = inDat.properties;
		
		Properties props = new Properties();
		
		inDat = new Ice.InitializationData();

		String confURL = "http://dcs.isa.ru/www/vladimirv/iarnet/client4IARnet2GeoProcessor.conf";
		
      URL fileURL = null;
      InputStream is = null;
      try   {
          fileURL = new URL(confURL);
      } catch  (java.net.MalformedURLException ex) {
         System.out.println("Malformed URL[" + confURL + "]. " + ex);
         throw(ex);
      }
      try   {
         is = fileURL.openStream(); //new FileInputStream(fileToLoad);
      }  catch(IOException ex)  {
         System.out.println(ex.toString());
         throw(ex);
      }
      
      try   {
         props.load(is);
      } catch(IOException ex) {
         System.out.println("Cann't load. " + ex.toString());
         throw(ex);
      }		
		is.close();
		
//		Enumeration keys = props.keys();
//		
//		while(keys.hasMoreElements())	{
//			String key = (String)keys.nextElement();
//			iceProps.setProperty(key, props.getProperty(key));
//		}

		props.list(System.out);
		//Ice.Util.initialize(arg0)
	}
	
}

